
public class BuildEntity {

	private static String SO = "so";
	private static String PROJECT_NAME = "project.name";
	private static String COMPANY = "company";
	private static String SYSTEM = "system";
	private static String PATH = "path";
	private static String PACKAGE = "package";

	private static String DAO = "dao";	
	private static String IEJB = "interface.ejb";	
	private static String EJB = "ejb";
	private static String WRAPPER = "wrapper";
	private static String MB = "mb";
	
	/*private static String XHTML = "pacote";
	private static String MESSAGES = "pacote";
	private static String MENU = "pacote";*/
	
	private String find(String property) {
		return FileUtil.directoryFromProperties("parametros.properties", property);	
	}
	
	private Boolean findFlag(String property) {
		return find(property).equals("true");	
	}
	
	public Entity build(String className){
		Entity entity = new Entity();
		entity.setClassName(className);
		entity.setSO(find(SO));
		entity.setProjectName(find(PROJECT_NAME));
		entity.setCompany(find(COMPANY));
		entity.setSystem(find(SYSTEM));
		entity.setBasePath(find(PATH));
		entity.setBasePackage(find(PACKAGE));

		entity.setDAO(findFlag(DAO));
		entity.setIEJB(findFlag(IEJB));
		entity.setEJB(findFlag(EJB));
		entity.setWRAPPER(findFlag(WRAPPER));
		entity.setMB(findFlag(MB));
				
		return entity;
	}

}
